package com.tiny.effects;

import java.awt.Graphics2D;

import com.tiny.core.game.Game;

/**
 * Classe abstrata que representa um efeito
 * 
 * @author Erick Zanardo
 *
 */
public abstract class Effect {
    protected Game game;
    protected boolean finished;

    public Effect(Game game) {
        this.game = game;
        finished = true;
    }

    public abstract void update(int currentFrame);

    public abstract void render(Graphics2D g);

    protected abstract void init(); 

    /**
     * Inicia o efeito
     */
    public void start() {
        finished = false;
        init();
    }

    /**
     * Retorna se o efeitos acabou
     * 
     * @return
     */
    public boolean isFinished() {
        return finished;
    }
}
